using System;
using System.Collections.Generic;
using Library;
using Library.Util;
using NHibernate;

namespace Library.Persistence.Cloud.Dao
{
	public class CloudFirmaIpDao : BaseEntity
	{
		private readonly string fromHql = " from CloudFirmaIp as t ";
		public void Insert(CloudFirmaIp dto)
		{
			BasePersistence.Insert(dto);
		}

		public void Update(CloudFirmaIp dto)
		{
			BasePersistence.Update(dto);
		}

		public void Delete(CloudFirmaIp dto)
		{
			BasePersistence.Delete(dto);
		}

		public void Delete(int firmaIpId)
		{
			CloudFirmaIp dto = new CloudFirmaIp();
			dto.FirmaIpId = firmaIpId;
			Delete(dto);
		}

		public CloudFirmaIp Get(int firmaIpId, LockMode lockMode)
		{
			return Get<CloudFirmaIp>(firmaIpId, lockMode);
		}

		public List<CloudFirmaIp> FindAll()
		{
			return Find<CloudFirmaIp>(fromHql, LockMode.Read);
		}

		public List<CloudFirmaIp> FindAll(string orderStatement)
		{
			return Find<CloudFirmaIp>(fromHql + " ORDER BY " + orderStatement, LockMode.Read);
		}

	}
}
